function addArticleSubmit() {
    var title = $("#title").val().trim();
    if (title == '') {
        $("#message").html("标题不能为空");
    }else{
        var inputCategoryName = $("#inputCategoryName").val().trim();
        if (inputCategoryName == '') {
            $("#message").html("分类不能为空");
        }else{
            $("#addArticle").submit();
        }
    }
};

function editArticleSubmit() {
    var title = $("#title").val().trim();
    if (title == '') {
        $("#message").html("标题不能为空");
    }else{
        var inputCategoryName = $("#inputCategoryName").val().trim();
        if (inputCategoryName == '') {
            $("#message").html("分类不能为空");
        }else{
            $("#updateArticle").submit();
        }
    }
};

function addArticleByCategorySubmit() {
    var title = $("#title").val().trim();
    if (title == '') {
        $("#message").html("标题不能为空");
    }else{
            $("#addArticleByCategory").submit();

    }
};


$(document).ready(function () {
    CKEDITOR.replace('content', {
        toolbar : [ [ 'Bold', 'Italic' ],
            [ 'NumberedList', 'BulletedList' ],
            [ 'Link', 'Unlink' ] ]
    });
});

